home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / getrusage.z / getrusage
Encoding:
Text File  |  1998-10-20  |  6.6 KB  |  199 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTRRRRUUUUSSSSAAAAGGGGEEEE((((3333))))                                                      GGGGEEEETTTTRRRRUUUUSSSSAAAAGGGGEEEE((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getrusage - get information about resource utilization
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttiiiimmmmeeee....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////rrrreeeessssoooouuuurrrrcccceeee....hhhh>>>>
  14.  
  15.      ####ddddeeeeffffiiiinnnneeee RRRRUUUUSSSSAAAAGGGGEEEE____SSSSEEEELLLLFFFF      0000         ////**** ccccaaaalllllllliiiinnnngggg pppprrrroooocccceeeessssssss ****////
  16.      ####ddddeeeeffffiiiinnnneeee RRRRUUUUSSSSAAAAGGGGEEEE____CCCCHHHHIIIILLLLDDDDRRRREEEENNNN  ----1111        ////**** tttteeeerrrrmmmmiiiinnnnaaaatttteeeedddd cccchhhhiiiilllldddd pppprrrroooocccceeeesssssssseeeessss ****////
  17.  
  18.      iiiinnnntttt ggggeeeettttrrrruuuussssaaaaggggeeee((((iiiinnnntttt wwwwhhhhoooo,,,, ssssttttrrrruuuucccctttt rrrruuuussssaaaaggggeeee ****rrrruuuussssaaaaggggeeee))));;;;
  19.  
  20. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      _G_e_t_r_u_s_a_g_e returns information describing the resources utilized by the
  22.      current process, or all its terminated child processes.  This routine is
  23.      provided for compatibility with 4.3BSD.
  24.  
  25.      The _w_h_o parameter is one of RUSAGE_SELF or RUSAGE_CHILDREN.  The buffer
  26.      to which _r_u_s_a_g_e points will be filled in with the following structure:
  27.  
  28.           struct rusage {
  29.                  struct timeval ru_utime;/* user time used */
  30.                  struct timeval ru_stime;/* system time used */
  31.                  long   ru_maxrss;
  32.                  long   ru_ixrss;     /* integral shared memory size */
  33.                  long   ru_idrss;     /* integral unshared data " */
  34.                  long   ru_isrss;     /* integral unshared stack " */
  35.                  long   ru_minflt;    /* page reclaims */
  36.                  long   ru_majflt;    /* page faults */
  37.                  long   ru_nswap;     /* swaps */
  38.                  long   ru_inblock;   /* block input operations */
  39.                  long   ru_oublock;   /* block output operations */
  40.                  long   ru_msgsnd;    /* messages sent */
  41.                  long   ru_msgrcv;    /* messages received */
  42.                  long   ru_nsignals;  /* signals received */
  43.                  long   ru_nvcsw;     /* voluntary context switches */
  44.                  long   ru_nivcsw;    /* involuntary " */
  45.           };
  46.  
  47.      The fields are interpreted as follows:
  48.  
  49.      ru_utime       the total amount of time spent executing in user mode.
  50.  
  51.      ru_stime       the total amount of time spent in the system executing on
  52.                     behalf of the process(es).
  53.  
  54.      ru_maxrss      the maximum resident set size utilized (in kilobytes).
  55.  
  56.      ru_minflt      the number of page faults serviced without any I/O
  57.                     activity; here I/O activity is avoided by "reclaiming" a
  58.                     page frame from the list of pages awaiting reallocation.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGEEEETTTTRRRRUUUUSSSSAAAAGGGGEEEE((((3333))))                                                      GGGGEEEETTTTRRRRUUUUSSSSAAAAGGGGEEEE((((3333))))
  71.  
  72.  
  73.  
  74.      ru_majflt      the number of page faults serviced that required I/O
  75.                     activity.
  76.  
  77.      ru_nswap       the number of times a process was "swapped" out of main
  78.                     memory.
  79.  
  80.      ru_inblock     the number of times the file system had to perform input.
  81.  
  82.      ru_oublock     the number of times the file system had to perform output.
  83.  
  84.      ru_msgsnd      the number of messages sent over sockets.
  85.  
  86.      ru_msgrcv      the number of messages received from sockets.
  87.  
  88.      ru_nsignals    the number of signals delivered.
  89.  
  90.      ru_nvcsw       the number of times a context switch resulted due to a
  91.                     process voluntarily giving up the processor before its
  92.                     time slice was completed (usually to await availability of
  93.                     a resource).
  94.  
  95.      ru_nivcsw      the number of times a context switch resulted due to a
  96.                     higher priority process becoming runnable or because the
  97.                     current process exceeded its time slice.
  98.  
  99.      The remaining fields are not maintained by the IRIX kernel and are set to
  100.      zero by this routine.
  101.  
  102. NNNNOOOOTTTTEEEESSSS
  103.      The numbers _r_u__i_n_b_l_o_c_k and _r_u__o_u_b_l_o_c_k account only for real I/O; data
  104.      supplied by the caching mechanism is charged only to the first process to
  105.      read or write the data.
  106.  
  107.      The _r_u__m_s_g_s_n_d and _r_u__m_s_g_r_c_v fields keep count of IPC messages sent and
  108.      received via the ssssoooocccckkkkeeeetttt (2) interface only.
  109.  
  110.      The _r_u__m_a_x_r_s_s field count includes shared pages.
  111.  
  112. EEEERRRRRRRROOOORRRRSSSS
  113.      The possible errors for _g_e_t_r_u_s_a_g_e are:
  114.  
  115.      [EINVAL]       The _w_h_o parameter is not a valid value.
  116.  
  117.      [EFAULT]       The address specified by the _r_u_s_a_g_e parameter is not in a
  118.                     valid part of the process address space.
  119.  
  120. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  121.      wait(2), see timers(5), gettimeofday(3) for details on the time
  122.      resolution.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GGGGEEEETTTTRRRRUUUUSSSSAAAAGGGGEEEE((((3333))))                                                      GGGGEEEETTTTRRRRUUUUSSSSAAAAGGGGEEEE((((3333))))
  137.  
  138.  
  139.  
  140. BBBBUUUUGGGGSSSS
  141.      There is no way to obtain information about a child process that has not
  142.      yet terminated.
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.